﻿using System;
using System.ServiceModel;
using System.ServiceModel.Activation;
using Medianamik.Core;
using System.Collections.Generic;

namespace Medianamik.UI.Services
{
    [ServiceContract(Namespace = "")]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class TypeManagementService
    {
        static List<String> PROPERTY_GROUP_NAMES = NodeTypeManager.GetPropertyGroupNames();

        // Add [WebGet] attribute to use HTTP GET
        [OperationContract]
        public String[] GetPropertyGroupNames(string prefixText, int count)
        {
            return PROPERTY_GROUP_NAMES.FindAll(delegate(String p)
            { return p.StartsWith(prefixText, StringComparison.OrdinalIgnoreCase); }
                ).ToArray();
        }
        
    }
}
